<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        function onsubmitway(){
            alert("表单已经提交!");
            return false;
        }
    </script>
</head>
<body>
    <!-- ruturn flase可以阻止表单提交！ -->
    <!-- ruturn ture可以使表单正常提交！ -->
    <form action="https://www.baidu.com/" method="get" onsubmit="return onsubmitway();">
        <input type="submit">
    </form>
</body>
</html>